/*
2021-11-8
https://ac.nowcoder.com/acm/contest/22551/C
*/
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;
const int N = 2e5 + 5;
ll a[N];

int main()
{
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; i++) cin >> a[i];

    sort(a, a + n);
    ll temp = 0;
    ll ans = a[n / 2];
    int cnt = 1;
    for (int i = n / 2; i < n; i++, cnt++)
    {
        if (i == n - 1) break;
        if (cnt * (a[i + 1] - a[i]) > k) break;
        ans += (a[i + 1] - a[i]);
        k -= cnt * (a[i + 1] - a[i]);
    }
    ans += k / cnt;
    cout << ans << endl;
    return 0;
}